<template>
  <div class="recommend">
    <Card></Card>
    <ul>
      <li v-for="(item, index) in recommendList" :key="index">
        <h2>
          <img :src="item.imgUrl" alt="" />
        </h2>
        <div>
          <h3>{{ item.name }}</h3>
          <p>{{ item.content }}</p>
          <div class="price">
            <span>¥</span>
            <b>{{ item.price }}</b>
          </div>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
import Card from "@/components/home/Card.vue";
export default {
  props:['recommendList'],
  components: {
    Card,
  },
};
</script>

<style scoped lang="scss">
.recommend ul li {
  position: relative;
  h2 {
    text-align: center;
  }
  img {
    width: 9.6rem;
    height: 3.84rem;
    border-radius: 12px;
  }
  > div {
    position: absolute;
    right: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: 0.533333rem;
    h3 {
      font-size: 12px;
    }
    p {
      font-size: 0.426666rem;
    }
  }
}
.price {
  margin-top: 0.666666rem;
  text-align: right;
  color: red;
  span {
    font-size: 0.373333rem;
  }
}
</style>
